<?php include('./templete/public/head.php') ?>
<!--<div class="head">-->
<!--    <div class="headpd">-->
<!--        <a class="iconfont posiabstion" href="javascript:history.go(-1)">&#xe606;</a>-->
<!--        在线留言-->
<!--    </div>-->
<!--</div>-->
<!--<hr style="height: .6rem;border: none;margin: 0;"/>-->
<div class="bgpic smpic" style="background-image: url(<?php echo $banner['img_url']?>);"></div>
<div class="leave-hint"><p>提示：请留下您的真实信息，平台会主动联系您！</p></div>
<div class="leave-table">
    <form action="<?php echo url('index')?>">
    <table>
        <tr>
            <td width="10.9375%"><i class="icons" style="background-image: url(_img/sm.png)"></i></td>
            <td width="99.890625%"><input type="text" id="username" placeholder="请输入您的姓名"/></td>
        </tr>
        <tr>
            <td width="10.9375%"><i class="icons font4" style="background-image: url(_img/sj.png)"></i></td>
            <td width="99.890625%"><input type="text" id="phone" placeholder="请输入您的手机号"/></td>
        </tr>
        <tr>
            <td width="10.9375%"><i class="icons font4" style="background-image: url(_img/ly.png)"></i></td>
            <td width="99.890625%"><textarea id="content" placeholder="请输入您的留言"></textarea></td>
        </tr>
    </table>
</div>
<hr class="eee"/>
<div class="btn"><a >提交</a></div>
</form>
<!--footer-->
<?php include('./templete/public/foot.php') ?>
<script>
    $('.btn').click(function () {
        var username = $('#username').val();
        if(!username){
            layer.msg('请输入您的姓名');return false;
        }
        var phone = $('#phone').val();
        if(!phone){
            layer.msg('请输入您的手机号');return false;
        }
        var content =$('#content').val();
        if(!content){
            layer.msg('请输入留言内容');return false;
        }
        $.ajax({
            url:'<?php echo url('index')?>',
            type:'post',
            dataType:'json',
            data:{
                username:username,
                phone:phone,
                content:content
            },
            success:function (data) {
                if(data.code==1){
                    layer.msg(data.msg);
                }else{
                    layer.msg(data.msg);
                }
            }
        })
    })
</script>